<?php
function getScript($name)
{
    if($name=='subscribe')
    {
        ?>
        <script type="text/javascript">
        var aj=new ajaxLoader;
        aj.init({url: "/as/regnewletter",func: succsubscribe});
        function sendsubscribe()
        {
            var email=getId("subscribe").value;
            if(!isEmail(email))
            {
                alert("<?php echo getLang("Please enter a valid email address")?>");
                return;
            } 
            
            aj.send("email="+email);
            //getId("butsubscribe").innerHTML= "<?php echo getLang("Sending")?>...";
        }
        function succsubscribe(obj)
        {    
            //getId("butsubscribe").innerHTML= "<?php echo getLang("Submit")?>";
            alert(obj.msg)
        }
        </script>
        <?
    }
}
?>